Skip to content

Use git ls-remote for autoloop branch discovery#20

Merged
mrjf merged 2 commits intomainfrom
copilot/fix-branch-discovery-without-remotes
Apr 4, 2026
Merged

Use git ls-remote for autoloop branch discovery#20
mrjf merged 2 commits intomainfrom
copilot/fix-branch-discovery-without-remotes

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 4, 2026

git branch -r --list origin/autoloop/* requires remote-tracking refs to be present locally, which they aren't in shallow checkouts (the default for actions/checkout). This causes the sync-branches workflow to silently find no branches.

Switch to git ls-remote --heads origin autoloop/* which queries the remote directly.

  • workflows/sync-branches.md — Replace git branch -r with git ls-remote --heads and update parsing for the <sha>\trefs/heads/<branch> output format
  • .github/workflows/sync-branches.lock.yml — Same change in the compiled Python version
// Before
const listResult = git('branch', '-r', '--list', 'origin/autoloop/*');
// ...
.map(b => b.replace('origin/', ''));

// After
const listResult = git('ls-remote', '--heads', 'origin', 'autoloop/*');
// ...
.map(b => b.replace(/^.*refs\/heads\//, ''));

Copilot AI assigned Copilot and mrjf Apr 4, 2026
Copilot AI linked an issue Apr 4, 2026 that may be closed by this pull request
@mrjf mrjf marked this pull request as ready for review April 4, 2026 04:39
Replace `git branch -r --list origin/autoloop/*` with
`git ls-remote --heads origin autoloop/*` so that branch discovery
works in shallow checkouts where remote-tracking refs aren't present.

Agent-Logs-Url: https://github.com/githubnext/autoloop/sessions/2817cf91-682b-41fb-82c1-79eeb961f4f0

Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix branch discovery without remotes Use git ls-remote for autoloop branch discovery Apr 4, 2026
Copilot finished work on behalf of mrjf April 4, 2026 04:41
Copilot AI requested a review from mrjf April 4, 2026 04:41
@mrjf mrjf merged commit eba845f into main Apr 4, 2026
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

branch discovery without remotes

2 participants